const allAdmin = [
  101,
  102,
  103,
  104,
  105,
  106,
  107,
  108,
  109,
  110,
  201,
  202,
  203,
  204,
  301,
  302,
  303,
  304,
  305,
  306,
  307,
  308,
  401,
  402,
  403,
  501,
  502,
  503,
  504,
  505,
  506,
  701,
  702,
  801,
  802,
  803,
  804,
  805,
  806,
  807,
  808,
  901,
  902,
  903,
  904,
  905,
  906,
  907,
  908,
  909,
  910,
  911,
  99991,
  99992,
  99993,
  99994,
  99996,
  99997,
  99998,
  99999,
  999990,
  999991,
  999992,
  999993,
  99999991,
  99999992,
  99999993,
  99999994,
  99999995,
  99999996,
];
const router = [
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      {
        name: 'login',
        path: '/user/login',
        component: './user/login',
      },
    ],
  },
  {
    path:
      '/testPage/:type/:subject/:p_type/:wrongs/:question_subject/:question_type/:question_p_type/:id', //在线练习
    component: './studentPage/testPage',
    authority: ['2'],
  },
  {
    path: '/examPage/:id/:type/:topic_id/:showAnswer', //模拟考试
    component: './studentPage/examPage',
    authority: ['2'],
  },
  {
    path: '/examPage2/:topic_id/:type/:subject/:subjects/:showAnswer', //模拟新题错题标记题
    component: './studentPage/examPage/examWrongOrMarked',
    authority: ['2'],
  },
  {
    path: '/printPaper/:id/:type' /* 打印试卷页面 */,
    component: './testPaper/Management/Paper',
    // authority: ['1'],//需要管理员权限
  },
  {
    path: '/printAnswer/:id/:type' /* 打印答案页面 */,
    component: './testPaper/Management/Answer',
    // authority: ['1'],//需要管理员权限
  },
  {
    path: '/checkPaper/:id' /* 查卷 */,
    component: './studentPage/Exam/CheckPaper',
  },
  {
    path: '/checkPaper2/:pid/:names' /* 查卷 */,
    component: './studentPage/Exam/CheckPaper2',
  },
  {
    path: '/',
    component: '../layouts/SecurityLayout',
    routes: [
      {
        path: '/',
        component: '../layouts/BasicLayout',
        authority: ['1', 'user'],
        routes: [
          {
            path: '/dashboard',
            name: 'home',
            icon: 'home',
            component: './dashboard',
          },
          {
            path: '/',
            redirect: '/dashboard',
          },
          {
            path: '/peopleManagement',
            name: 'peoples',
            icon: 'team',
            authority: [
              101,
              102,
              103,
              104,
              105,
              106,
              107,
              108,
              109,
              110,
              111,
              901,
              902,
              903,
              904,
              905,
              906,
              907,
              908,
              909,
              910,
              911,
            ],
            routes: [
              {
                path: '/peopleManagement/peoples/:tab', //人员信息管理
                name: 'peoples',
                component: './peoples',
                authority: [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111],
              },
              {
                path: '/peopleManagement/tzPeoples/:tab', //特种作业人员信息管理
                name: 'tzPeoples',
                component: './peoples',
                authority: [901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911],
              },
              // {
              //   path: '/peopleManagement/zyws/:tab', //特种作业人员信息管理
              //   name: 'zyws',
              //   component: './peoples',
              //   authority: [101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111],
              // },
              
              {
                path: '/peopleManagement/unitStructure', //部门管理
                name: 'unit',
                component: './peoples/UnitStructure',
              },
              {
                path: '/peopleManagement/examAnalyze', //单人模拟考试统计
                component: './peoples/UserManagement/ExamAnalyze',
              },
            ],
          },

          {
            path: '/examInfo', //考试信息管理
            name: 'examInfo',
            icon: 'profile',
            authority: [
              201,
              202,
              203,
              204,
              301,
              302,
              303,
              304,
              305,
              306,
              307,
              308,
              501,
              502,
              503,
              504,
              505,
              506,
            ],
            routes: [
              {
                path: '/examInfo/lessons', //考试科目管理
                name: 'lessons',
                component: './lessons',
                authority: [201, 202, 203, 204],
              },
              {
                path: '/examInfo/questionBank/:tab', //考试题库管理
                name: 'questionBank',
                component: './questionBank',
                authority: [306, 307, 301, 308],
              },
              {
                path: '/examInfo/testPaper/:tab', //试卷信息管理
                name: 'testPaper',
                component: './testPaper',
                authority: [501, 502, 503, 504, 505, 506], //需要管理员权限
              },

              {
                path: '/examInfo/bank/edit/:id', //考试题修改
                component: './questionBank/BankManagement/Edit',
                authority: [303],
              },
              {
                path: '/examInfo/bank/show/:id', //考试题查看
                component: './questionBank/BankManagement/Show',
              },
            ],
          },
          {
            path: '/tzExamInfo', //考试信息管理
            name: 'tzExamInfo',
            icon: 'profile',
            authority: [
              99991,
              99992,
              99993,
              99994,
              99996,
              99997,
              99998,
              99999,
              999990,
              999991,
              999992,
              999993,
              99999991,
              99999992,
              99999993,
              99999994,
              99999995,
              99999996,
            ],
            routes: [
              {
                path: '/tzExamInfo/lessons', //考试科目管理
                name: 'lessons',
                component: './lessons',
                authority: [99991, 99992, 99993, 99994],
              },
              {
                path: '/tzExamInfo/questionBank/:tab', //考试题库管理
                name: 'questionBank',
                component: './questionBank',
                authority: [999991, 999992, 99996, 999993],
              },
              {
                path: '/tzExamInfo/testPaper/:tab', //试卷信息管理
                name: 'testPaper',
                component: './testPaper',
                authority: [99999991, 99999992, 99999993, 99999994, 99999995, 99999996], //需要管理员权限
              },

              {
                path: '/tzExamInfo/bank/edit/:id', //考试题修改
                component: './questionBank/BankManagement/Edit',
                authority: [99998],
              },
              {
                path: '/tzExamInfo/bank/show/:id', //考试题查看
                component: './questionBank/BankManagement/Show',
              },
            ],
          },
          {
            path: '/paperAnalyze/:id', //试卷信息管理
            component: './testPaper/Management/Analyze',
            authority: allAdmin, //需要管理员权限
          },
          {
            path: '/paperTzAnalyze/:id', //试卷信息管理
            component: './testPaper/Management/Analyze',
            authority: allAdmin, //需要管理员权限
          },
          {
            path: '/editRandom/:id', //编辑随机组卷
            component: './testPaper/Random/Edit',
            authority: [503], //需要管理员权限
          },
          {
            path: '/editTzRandom/:id', //编辑随机组卷
            component: './testPaper/Random/Edit',
            authority: [99999993], //需要管理员权限
          },
          {
            path: '/showRandom/:id', //查看随机组卷
            component: './testPaper/Random/Show',
            authority: [501, 502, 503, 504, 505, 506], //需要管理员权限
          },
          {
            path: '/showTzRandom/:id', //查看随机组卷
            component: './testPaper/Random/Show',
            authority: [99999991, 99999992, 99999993, 99999994, 99999995, 99999996], //需要管理员权限
          },
          {
            path: '/editManual/:id', //编辑人工组卷
            component: './testPaper/Manual/Edit',
            authority: [503], //需要管理员权限
          },
          {
            path: '/editTzManual/:id', //编辑人工组卷
            component: './testPaper/Manual/Edit',
            authority: [99999993], //需要管理员权限
          },
          {
            path: '/showManual/:id', //查看人工组卷
            component: './testPaper/Manual/Show',
            authority: [501, 502, 503, 504, 505, 506], //需要管理员权限
          },
          {
            path: '/showTzManual/:id', //查看人工组卷
            component: './testPaper/Manual/Show',
            authority: [99999991, 99999992, 99999993, 99999994, 99999995, 99999996], //需要管理员权限
          },
          {
            path: '/addTemplate', //添加试卷参数模板
            component: './testPaper/ParamTemplate/Add',
            authority: [505], //需要管理员权限
          },
          {
            path: '/addTzTemplate', //添加试卷参数模板
            component: './testPaper/ParamTemplate/Add',
            authority: [99999995], //需要管理员权限
          },
          {
            path: '/editTemplate/:id', //编辑试卷参数模板
            component: './testPaper/ParamTemplate/Edit',
            authority: [506], //需要管理员权限
          },
          {
            path: '/editTzTemplate/:id', //编辑试卷参数模板
            component: './testPaper/ParamTemplate/Edit',
            authority: [99999996], //需要管理员权限
          },
          {
            path: '/learn', //学习培训管理
            name: 'learn',
            icon: 'userSwitch',
            authority: allAdmin, //需要管理员权限
            routes: [
              {
                path: '/learn/courseware', //电子课件管理
                name: 'courseware',
                component: './Learn/courseware',
              },
              {
                path: '/learn/teachingMterials', //电子教材管理
                name: 'teachingMterials',
                component: './Learn/teachingMterials',
              },
            ],
          },

          {
            path: '/analyze',
            name: 'analyze',
            icon: 'barChart',
            authority: allAdmin,
            routes: [
              {
                path: '/analyze/practiceAnalyze', //练习统计
                name: 'practiceAnalyze',
                component: './analyze/practice',
              },
              {
                path: '/analyze/examAnalyze', //考试统计
                name: 'examAnalyze',
                component: './analyze/exam',
              },
              {
                path: '/analyze/learnAnalyze', //课件统计
                name: 'learnAnalyze',
                component: './analyze/learn',
              },
            ],
          },
          {
            path: '/apply_form', //申请表管理
            name: 'apply_form',
            icon: 'form',
            authority: [703],
            component: './settings/apply_form',
          },
          {
            path: '/setting',
            name: 'setting',
            icon: 'setting',
            authority: allAdmin,
            routes: [
              {
                path: '/setting/system', //系统设置
                name: 'system',
                component: './settings/system',
                authority: [701],
              },
              {
                path: '/setting/record', //系统日志
                name: 'record',
                component: './dashboard/record',
                authority: [702],
              },
            ],
          },
          {
            path: '/notice',
            name: 'notice',
            icon: 'notification',
            authority: [801, 802, 803],
            routes: [
              {
                path: '/notice/dynamic', //培训动态
                name: 'dynamic',
                component: './settings/dynamic',
                authority: [801],
              },
              {
                path: '/notice/dynamic/add', //添加培训动态
                component: './settings/dynamic/add',
                authority: [801],
              },
              {
                path: '/notice/dynamic/edit/:id', //编辑培训动态
                component: './settings/dynamic/edit',
                authority: [801],
              },
              {
                path: '/notice/introduce', //学员公告
                name: 'introduce',
                component: './settings/introduce',
                authority: [802],
              },
              {
                path: '/notice/policy', //政策法规
                name: 'policy',
                component: './settings/policy',
                authority: [803],
              },

              {
                path: '/notice/plan', //考试计划
                name: 'plan',
                component: './settings/plan',
                authority: [805],
              },
              {
                path: '/notice/plan/add', //添加培训动态
                component: './settings/plan/add',
                authority: [805],
              },
              {
                path: '/notice/plan/edit/:id', //编辑培训动态
                component: './settings/plan/edit',
                authority: [805],
              },
              {
                path: '/notice/business', //业务介绍
                name: 'business',
                component: './settings/business',
                authority: [804],
              },
              {
                path: '/notice/emergency_read', //考生必读(应急)
                name: 'emergency_read',
                component: './settings/emergency_read',
                authority: [806],
              },
              {
                path: '/notice/market_read', //考生必读(市场)
                name: 'market_read',
                component: './settings/market_read',
                authority: [807],
              },
              {
                path: '/notice/banner', //轮播图设置
                name: 'banner',
                component: './settings/banner',
                authority: [808],
              },
              
            ],
          },
          /* 以下为考生端 */
          {
            path: '/info', //个人信息
            name: 'info',
            icon: 'user',
            component: './studentPage/Info',
            authority: ['2'],
          },
          {
            path: '/practice', //在线练习
            name: 'practice',
            icon: 'edit',
            component: './studentPage/Practice',
            authority: ['2'],
          },

          {
            path: '/exam/:subject/:showAnswer', //模拟考试
            component: './studentPage/Exam',
            authority: ['2'],
          },
          {
            path: '/select', //模拟考试
            name: 'exam',
            icon: 'schedule',
            component: './studentPage/Exam/select',
            authority: ['2'],
          },
          {
            path: '/checkPaperList', //查卷信息
            component: './studentPage/Exam/CheckPaperList',
            authority: ['2'],
          },
          {
            path: '/select/more/:subject/:subjects', //模拟考试
            component: './studentPage/Exam/selectMore',
            authority: ['2'],
          },
          {
            path: '/train', //培训学习
            name: 'train',
            icon: 'book',
            component: './studentPage/Train',
            authority: ['2'],
          },
          {
            path: '/learnAnalyze', //学习统计
            name: 'learnAnalyze',
            icon: 'pieChart',
            component: './studentPage/learnAnalyze',
            authority: ['2'],
          },
          {
            path: '/learnAnalyze/print', //学习统计
            component: './studentPage/learnAnalyze/print',
            authority: ['2'],
          },
          {
            path: '/document', //文档
            component: './studentPage/document',
            authority: ['2'],
          },
          /* 以上为考生端 */
          {
            path: '/file/:id/:is_jc' /* 读取文件的页面 */,
            component: './FileRead',
          },
          {
            path: '/read' /* 读取文件的页面 */,
            component: './FileRead/reader',
          },
          {
            component: './404',
          },
        ],
      },

      {
        component: './404',
      },
    ],
  },
  {
    component: './404',
  },
];
export default router;
